package com.qf.hospital.service.impl;

import com.qf.hospital.entity.RegisterExample;
import com.qf.hospital.mapper.RegisterMapper;
import com.qf.hospital.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Administrator
 * @version V1.0
 * @Project hospital
 * @Package com.qf.hospital.service.impl
 * @Description: ${TODO}
 * @Date 2021/10/19 19:52
 */
@Service
public class RegisterServiceImpl implements RegisterService {

    private final int DELETE = 0;

    @Autowired
    private RegisterMapper registerMapper;


    @Override
    public Integer findZhuYuanTotal() {
        RegisterExample example = new RegisterExample();
        RegisterExample.Criteria criteria = example.createCriteria();
        criteria.andStateNotEqualTo(DELETE);

        long count = registerMapper.countByExample(example);
        return Integer.valueOf(count + "");
    }

    @Override
    public Integer findCurrentZhuYuan() {
        long count = registerMapper.findZhuYuanCurrent();
        return Integer.valueOf(count + "");
    }
}
